package com.polidea.rxohosble2.exceptions;


import com.polidea.rxohosble2.RxBleConnection;
import ohos.bluetooth.ble.BlePeripheralDevice;
import ohos.bluetooth.ble.GattCharacteristic;

/**
 * An exception being emitted from {@link RxBleConnection#readCharacteristic(GattCharacteristic)}
 * or other characteristic related observables when the {@link ohos.bluetooth.ble.BlePeripheralCallback} is called with status other than
 * {@link ohos.bluetooth.ble.BlePeripheralDevice#GATT_SUCCESS}
 */
public class BleGattCharacteristicException extends BleGattException {

    public final GattCharacteristic characteristic;

    public BleGattCharacteristicException(
            BlePeripheralDevice gatt,
            GattCharacteristic characteristic,
            int status,
            BleGattOperationType bleGattOperationType
    ) {
        super(gatt, status, bleGattOperationType);
        this.characteristic = characteristic;
    }
}
